﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class CMS_FriendLink : System.Web.UI.UserControl
{
    Usas.BLL.Cms.cms_block_common_detail cbcd = new Usas.BLL.Cms.cms_block_common_detail();
    Usas.Model.Cms.cms_block_common_detail cbcdm = new Usas.Model.Cms.cms_block_common_detail();
    Usas.BLL.Cms.cms_block cb = new Usas.BLL.Cms.cms_block();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            string id = cb.GetList("b_path='FriendLink.ascx'").Tables[0].Rows[0]["b_id"].ToString();
            string type = "Default.aspx";

            DataSet ds = cbcd.GetList("c_b_id=" + id + " and c_type='" + type + "' and c_view=1");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
              
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    link.InnerHtml += "<li><a href='" + ds.Tables[0].Rows[i]["c_value"].ToString() +
                        "' class='link' style='font-size: 15px; text-decoration: none;'target='_blank'>" +
                        ds.Tables[0].Rows[i]["c_des"].ToString() + "</a></li>";
                }

            }

        }
    }
}
